﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace Engine
{
	public static class CUtilities
	{
		public static void CenterPictureBox(PictureBox oPictureBox)
		{
			Point ptLocation = new Point();

			ptLocation.X = (oPictureBox.Parent.ClientSize.Width / 2) - (oPictureBox.Width / 2);
			ptLocation.Y = (oPictureBox.Parent.ClientSize.Height / 2) - (oPictureBox.Height / 2);

			oPictureBox.Location = ptLocation;
		}

		public static void CenterLabel(Label oLabel)
		{
			Point ptLocation = new Point();
		
			ptLocation.X = (oLabel.Parent.ClientSize.Width / 2) - (oLabel.Width / 2);
			ptLocation.Y = oLabel.Location.Y;

			oLabel.Location = ptLocation;
		}
	}
}
